Embedded Integration Code

PHP, Node.js, Python, and Java examples for embedded (S2S) checkout.

Embedded Integration gives you full control over the checkout experience by allowing you to collect payment details on your own website and securely process payments through DigetPay Server-to-Server (S2S) APIs.

Unlike Hosted Checkout, your application owns the checkout UI, customer experience, and payment flow.


What you'll build

This guide provides complete server-side examples for:

  • Request Hash (MD5) generation
  • Direct Sale (S2S)
  • 3-D Secure (3DS) handling
  • Transaction Status verification
  • Capture & Void operations
  • Webhook processing
  • Apple Pay integration (separate flow)
📘

Before you begin

Make sure you have:

  • Sandbox merchant account
  • Fin API Key (x-api-key)
  • Backend application (PHP, Node.js, Python, or Java)
  • HTTPS-enabled endpoints
  • Basic knowledge of REST APIs
🚧

PCI DSS Requirement

Embedded Integration requires your application to securely handle payment card data.

This integration is suitable only for merchants that meet PCI DSS (SAQ D or equivalent) requirements.

If your business does not require a fully customized checkout experience, we strongly recommend using Hosted Checkout to reduce PCI scope.

❗️

Security Notice

Never send card data directly from browser JavaScript to DigetPay.

The recommended flow is:

Customer → Your Backend → DigetPay API

Your backend should:

  • Generate the request hash
  • Send payment requests
  • Handle 3-D Secure responses
  • Process webhooks
  • Verify transaction status

Integration Flow

flowchart LR

A[Customer Checkout]

B[Merchant Backend]

C[Generate Request Hash]

D[Direct Sale API]

E{Response}

F[Approved]

G[3-D Secure]

H[Declined]

I[Webhook]

J[Transaction Status]

K[Update Order]

A --> B
B --> C
C --> D
D --> E

E --> F
E --> G
E --> H

F --> I
G --> I

I --> J
J --> K

Apple Pay

Apple Pay for Embedded Integration uses a dedicated implementation.

Unlike Hosted Checkout, your application is responsible for displaying the Apple Pay button, creating the payment session, and submitting the payment token.


Related Guides



Did this page help you?